package swag.events {
	
	import swag.interfaces.events.ISwagEvent;
	
	/**
	 * The base class for all Swag events. This class may be sub-classed, or sent directly, to the <code>SwagDispatcher</code>.
	 * 
	 * @author Patrick Bay
	 * 
	 */	
	public class SwagEvent implements ISwagEvent {
		
		/**
		 * The default <code>SwagEvent</code> type. The string value "swagDefaultEvent" may also be used but
		 * using this constant value is advisable in order to prevent potentially numerous code updates if it ever changes. 
		 */
		public static const DEFAULT:String="SwagEvent.DEFAULT";
		/**
		 * @private 
		 */
		private var _type:String=null;
		/**
		 * @private 
		 */
		private var _source:*=null;
		
		/**
		 * The default constructor for the SwagEvent class. 
		 *  
		 * @param eventType The type of event to create. It's highly advisable to use one of the event constant strings 
		 * provided with the various event types in order to easily maintain code changes (especially if event types 
		 * change in future revisions).
		 * 
		 * @see swag.core.SwagDispatcher
		 */
		public function SwagEvent(eventType:String=null) {
			this.type=eventType;
		}//constructor		
		
		/**
		 * 
		 * The event type string, typically one of the <code>SwagEvent</code>-derived types defined in the toolkit.
		 * 
		 */
		public function get type():String {
			return (this._type);
		}//get type
		
		public function set type(typeSet:String):void {
			this._type=typeSet;
		}//set type
		
		/**
		 * 
		 * A reference to the source object that dispatched this event instance.
		 * 
		 */
		public function get source():* {
			return (this._source);
		}//get source
		
		public function set source(sourceSet:*):void {
			this._source=sourceSet;
		}//set source
		
	}//SwagEvent class
	
}//package